import request from '../base.ts';

const url = '/member-information';

// 根据条件获取社团成员分页列表
export const getList = (page: number, limit: number, params?: IObj) => {
  return request.get(`${url}/${page}/${limit}`, {
    params
  })
}

// 导入社团成员
export const importPartyMember = (flag: boolean, data: IObj[]) => {
  return request({
    url: `${url}/importMemberInfo`,
    method: 'post',
    params: {
      flag
    },
    data
  })
} 

// 新增社团成员
export const addMember = (data: IObj) => {
  return request.post(`${url}/add`, data);
}

// 改
export const editMember = (data: IObj) => {
  return request.post(`${url}/update`, data);
}

// 删
export const deleteMember = (id: number) => {
  return request.delete(`${url}/deleted/${id}`)
}

export const deleteMemberList = (data: number[]) => {
  return request.delete(`${url}/deletedList`, {
    data
  });
}


export const getAll = () => {
  return request.get(`${url}/getAll`);
}